package com.myk.game.gobangchess;

import com.myk.game.gobangchess.constants.Msger;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;


public class AskInput {

    //++暂时先这样简单写写,以后用的时候再优化

    private static final Map<String, AskInput> askListenerMap = new ConcurrentHashMap<>();

    public static AskInput getAsk(String askId) {
        return askListenerMap.get(askId);
    }


    Player target;
    String askId = "wenjuandiaocha";
    String title = "问卷调查";
    String topTip = "请输入你想对逆界的建议";
    String midTip = "输入20字符以内";
    String bottomTip = "输入完成后请点击{{提交@color=#FF5522}}按钮进行提交";
    boolean isForce = false;
    String limit = "-1";

    public void dispatch(Player target) {
        this.target = target;
        this.askId = "wenjuandiaocha";
        this.title = "问卷调查";
        this.topTip = "-1";
        this.midTip = "输入100字符以内";
        this.bottomTip = "请输入您想对逆界主创团队的话，输入完成后请点击{{提交@color=#FF5522}}按钮进行提交，我们会再后期公告里报告更新进度";
        this.isForce = true;
        this.limit = "-1";
        askListenerMap.put(askId, this);
        target.sendMessage(Msger.dispatchAskInputDialog, askId + "&" + title +"&" + topTip + "&" + midTip + "&" + bottomTip + "&" + isForce + "&" + limit);
    }

    public void receive(String inputText) {
        System.out.println("askId:" + askId + "  " + "inputText:" + inputText);
    }
}
